package com.csair.irp.job.file.parser.manual;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.csair.irp.job.file.parser.manual.ManualTemplateMapper;
import com.csair.irp.job.file.parser.manual.ManualTemplatePO;
import com.csair.irp.job.file.task.FileBaseinfoPO;
import com.csair.irp.job.file.task.FileBaseinfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author liaolonglong
 */
@Service
public class ManualTemplateService extends ServiceImpl<ManualTemplateMapper, ManualTemplatePO> {

    /**
     * 根据file
     * @param fileBaseinfo
     * @return
     */
    public ManualTemplatePO getByFileBaseinfo(FileBaseinfoPO fileBaseinfo) {
        QueryWrapper<ManualTemplatePO> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("data_resource_type", fileBaseinfo.getDataResourceType());
        queryWrapper.eq("data_file_class", fileBaseinfo.getDataFileClass());
        queryWrapper.eq("gateway_type", fileBaseinfo.getGatewayType());
        return getOne(queryWrapper);
    }
}
